<?php 
/*
 * @Descripttion: 
 * @version: v1
 * @Author: Terry
 * @Date: 2020-08-18 16:32:30
 * @LastEditors: Terry
 * @LastEditTime: 2024-10-21 16:05:53
 */

// ======================对外api====================


use think\facade\Route;

//后台管理路由api
Route::group('admin/v1/', function () {
    
    //运营概览
    Route::group("overView/",function(){
        Route::get('getData', 'overView/getData');//運維數據
        Route::get('getflowDetail', 'overView/getflowDetail');//获取流量使用详情
        Route::get('getRangeFlow', 'overView/getRangeFlow');//获取7天范围内的使用情况
        Route::get('getAppData', 'overView/getAppData');//获取手机管理端的数据
    })->middleware(['checkLogin','checkAuth','checkData']);

    //摄像头
    Route::group('camera/',function(){
        Route::group(function(){
            Route::get('getList', 'camera/getList');//获取摄像头列表
            Route::get('getChannelData', 'camera/getChannelData');//获取摄像头/nvr 通道信息
            Route::get('getChannelList', 'camera/getChannelList');//获取子通道数据
            Route::post('create', 'camera/create');//设备添加
            Route::put('update', 'camera/update');//设备更新
            Route::delete('destroy', 'camera/destroy');//设备删除
            Route::get('getCameraDetail', 'camera/getCameraDetail');//获取设备详情信息
            Route::post('changeStatus', 'camera/changeStatus');//获取设备详情信息
            Route::get('getNvrChannel', 'camera/getNvrChannel');//获取nvr所有通道信息
            Route::get('refreshChannel', 'camera/refreshChannel');//重新获取子通道信息
            Route::get('getCloudList', 'camera/getCloudList');//重新获取子通道信息
            Route::get('getCloudDate', 'camera/getCloudDate');//重新获取子通道信息
        })->middleware(['checkAuth','checkData']);
        
        Route::get('getDic', 'camera/getDic');//获取设备详情信息
    })->middleware(['checkLogin']);

    //视频播放
    Route::group("realtime/",function(){
        Route::get('getList', 'realtime/getList');//视频播放列表
        Route::put('update', 'realtime/update');//视频播放列表更新
        Route::post('cameraControl', 'realtime/cameraControl');//视频播放列表更新
    })->middleware(['checkLogin','checkAuth','checkData']);

    //账号设置
    Route::group('config/',function(){
        Route::get('getList', 'config/getList');//视频播放列表 
        Route::post('create', 'config/create');//视频播放列表 
        Route::put('update', 'config/update');//视频播放列表 
        Route::delete('destroy', 'config/destroy');//视频播放列表 
    })->middleware(['checkLogin','checkAuth','checkData']);

     //摄像头类型
     Route::group('type/',function(){
        Route::group(function(){
            Route::get('getList', 'type/getList');//获取摄像头类型
            Route::post('create', 'type/create');//摄像头类型添加
            Route::put('update', 'type/update');//摄像头类型更新
            Route::delete('destroy', 'type/destroy');//摄像头类型删除
            Route::get('getDetail', 'type/getDetail');//获取摄像头类型详情信息
            Route::get('getCameraList', 'type/getCameraList');//获取已绑定摄像头列表
            Route::get('getBindList', 'type/getBindList');//获取绑定摄像头穿梭框字典
            Route::put('bindCamera', 'type/bindCamera');//绑定设备头
            Route::delete('unbindCamera', 'type/unbindCamera');//删除绑定摄像头
        })->middleware(['checkData']);
        
    })->middleware(['checkLogin']);

     //AI摄像头预警
     Route::group('aicam/',function(){
        Route::group(function(){
            Route::get('getList', 'aicam/getList');//AI摄像头预警列表
            Route::get('getOptions', 'aicam/getOptions');//AI摄像头预警字典表
            Route::delete('destroy', 'aicam/destroy');//AI摄像头预警删除
        })->middleware(['checkData']);
        
    })->middleware(['checkLogin']);

})->prefix('admin.v1.')->middleware('dataEncryption');